{% extends 'base.html' %}
{% load staticfiles %}
{% block title %}俺们小组的网站{% endblock %}
{% block nav_test_active %}active{% endblock %}
{% block header_extends %}
    <link rel="stylesheet" href="{% static 'test_list.css' %} ">
    <!-- <link rel="stylesheet" href="/blog/static/blog_list.css"> -->
{#    <link rel="stylesheet" href="../static/blog_list.css">#}
{% endblock %}
{% block content %}
    <div class="container">
        <div class="row">
            <div class="col-xs-12 col-sm-8 col-md-8">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <button class="btn btn-primary text-right" type="button">
                          {% block test_list_title %}实验列表{% endblock %}
                                <span class="badge">
                                        {{ page_of_tests.paginator.count }}
                                </span>
                        </button>
                        <div class="btn-group " style="float:right">
                            <button type="button" class="btn btn-default dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            算法比较<span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <li><a href="{% url 'test_comp' %}">三种算法比较</a></li>
                                <li><a href="{% url 'test_alone' %}">单独的算法比较 </a></li>
{#                                <li role="separator" class="divider"></li>#}
{#                                <li><a href="{% url 'blog_list' %}">全部</a></li>#}
                            </ul>
                        </div>
                    </div>
                    <div class="panel-body">
                        {% for test in tests %}
                            <div class="test">
                                <h3><a href="{% url 'test_detail' test.id %}">
                                    {{ test.title }}</a>
                                </h3>
                                <p class="test-info">
                                    <span class="glyphicon glyphicon-tags" >
                                        {{ test.test_type }}
                                    </span>
                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                    <span class="glyphicon glyphicon-time" >
                                        {{ test.created_time|date:"Y-m-d"  }}
                                    </span>
                            </div>
                        {% empty %}
                            <div class="test">
                                <h3>-- 暂无实验 --</h3>
                            </div>

                        {% endfor %}
                    </div>
                    <div class="panel-footer" style=" padding:0">
                        <nav aria-label="Page navigation" style="text-align: center;">
                          <ul class="pagination search">
                            <li>
                                {% if page_of_tests.has_previous %}
                                    <a href="?page=page_of_tests.previous_page_number" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                {% else %}
                                    <span aria-hidden="true">NP</span>
                                {% endif %}
                            </li>
                              {% for page_num in page_range %}
                                  {% if page_num == page_of_blogs.number %}
                                      <li class="active"><a href="?page={{ page_num }}">{{ page_num }}</a></li>
                                  {% else %}
                                      {% if page_num == "..." %}
                                          <li><a>{{ page_num }}</a></li>
                                      {% else %}
                                          <li><a href="?page={{ page_num }}">{{ page_num }}</a></li>
                                      {% endif %}
                                  {% endif %}
                              {% endfor %}
                            <li>
                                {% if page_of_tests.has_next %}
                                    <a href="?page={{ page_of_tests.next_page_number }}" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                {% else %}
                                    <span aria-hidden="true">NN</span>
                                {% endif %}
                            </li>
                          </ul>
                        </nav>
                    </div>
                </div>

            </div>
            <div class="hidden-xs col-sm-4 col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        {% block test_info %}实验分类{% endblock %}
                    </div>
                    {% block test_info_content %}
                        <div class="panel-body">
                            <ul class="test-types" >
                                {% for test_type in test_types %}
                                    <li>
                                        <a href="{% url 'home' %}">
                                            {{ test_type.type_name }}({{ test_type.test_count }})
                                        </a>
                                    </li>
                                {% empty %}
                                    <li>暂无分类</li>
                                {% endfor %}
                            </ul>
                        </div>
                    {% endblock %}
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        日期归档
                    </div>
                    <div class="body">
                        <ul class="date">
                            {% for test_date, test_count in test_dates.items %}
                                <li class="date_record">
                                    <a href="{% url 'home'%}">
                                        {{ test_date|date:"Y年m月" }}({{ test_count }})
                                    </a>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                </div>
            </div>
        </div>

    </div>

{% endblock %}